<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<center>
		<form action="{url:/email/register}" method="post">
			用户名：<input type="text" name="name" id="name"><br>
			密  码：<input type="password" name="password" id="password"><br>
			邮  箱：<input type="email" name="email" id="email"><br>
			<input type="button" id="btn" value="注册">
		</form>
	</center>
</body>
</html>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
	$("#btn").click(function(){

		var name = $("#name").val();
		var pwd = $("#pwd").val();
		var email = $("#email").val();

		if (name=="" || pwd=="" || email=="") {
			alert("输入内容不能为空");
			return false;
		}

		var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9_])+\.)+([a-zA-Z0-9_]{2,4})+$/;
		if (!filter.test(email)) {
			alert('您的电子邮件格式不正确');
			return false;
		}

		$("form").submit();

	});

		
</script>